#include "nad_hboxs.h"
#include "../GlobalVars/vars.h"
#include "../TextureFunctions/texturefunctions.h"
#include <GL/gl.h>


	void
hboxs()
{
	static GLfloat VertexData[] = {
		-0.319672f, 0.606557f, 0.327869f, -0.319672f, 0.606557f, 0.327869f, -0.319672f, 0.606557f, 0.327869f, 
		-0.319672f, 0.000000f, 0.327869f, -0.319672f, 0.000000f, 0.327869f, 
		-0.319672f, 0.000000f, 0.327869f, 0.336066f, 0.606557f, 0.327869f, 
		0.336066f, 0.606557f, 0.327869f, 0.336066f, 0.606557f, 0.327869f, 
		0.336066f, 0.000000f, 0.327869f, 0.336066f, 0.000000f, 0.327869f, 
		0.336066f, 0.000000f, 0.327869f, 0.336066f, 0.606557f, -0.327869f, 
		0.336066f, 0.606557f, -0.327869f, 0.336066f, 0.606557f, -0.327869f, 
		0.336066f, 0.000000f, -0.327869f, 0.336066f, 0.000000f, -0.327869f, 
		0.336066f, 0.000000f, -0.327869f, -0.319672f, 0.606557f, -0.327869f, 
		-0.319672f, 0.606557f, -0.327869f, -0.319672f, 0.606557f, -0.327869f, 
		-0.319672f, 0.000000f, -0.327869f, -0.319672f, 0.000000f, -0.327869f, 
		-0.319672f, 0.000000f, -0.327869f
	};
	static GLfloat NormalData[] = {
		0.000000f, 1.00000f, 0.000000f, -1.00000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.00000f, 
		0.000000f, -1.00000f, 0.000000f, -1.00000f, 0.000000f, 0.000000f, 
		0.000000f, 0.000000f, 1.00000f, 0.000000f, 1.00000f, 0.000000f, 
		1.00000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.00000f, 
		0.000000f, -1.00000f, 0.000000f, 1.00000f, 0.000000f, 0.000000f, 
		0.000000f, 0.000000f, 1.00000f, 0.000000f, 1.00000f, 0.000000f, 
		0.000000f, 0.000000f, -1.00000f, 1.00000f, 0.000000f, 0.000000f, 
		0.000000f, -1.00000f, 0.000000f, 0.000000f, 0.000000f, -1.00000f, 
		1.00000f, 0.000000f, 0.000000f, 0.000000f, 1.00000f, 0.000000f, 
		-1.00000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, -1.00000f, 
		0.000000f, -1.00000f, 0.000000f, -1.00000f, 0.000000f, 0.000000f, 
		0.000000f, 0.000000f, -1.00000f
	};
	static GLfloat TexCoordData[] = {
		0.000000f, 0.000000f, 1.00000f, 1.00000f, 0.000000f, 1.00000f, 
		0.000000f, 1.00000f, 1.00000f, 0.000000f, 
		0.000000f, 0.000000f, 1.00000f, 0.000000f, 
		0.000000f, 1.00000f, 1.00000f, 1.00000f, 
		1.00000f, 1.00000f, 0.000000f, 0.000000f, 
		1.00000f, 0.000000f, 1.00000f, 1.00000f, 
		0.000000f, 1.00000f, 1.00000f, 1.00000f, 
		1.00000f, 0.000000f, 0.000000f, 0.000000f, 
		1.00000f, 0.000000f, 0.000000f, 1.00000f, 
		0.000000f, 1.00000f, 1.00000f, 1.00000f, 
		0.000000f, 0.000000f, 0.000000f, 0.000000f, 
		1.00000f, 0.000000f
	};
	static GLint Indices[] = {
		2, 5, 8, 5, 11, 8, 7, 10, 14, 10, 17, 14, 13, 16, 20, 16, 
		23, 20, 19, 22, 1, 22, 4, 1, 18, 0, 12, 0, 6, 12, 3, 21, 
		9, 21, 15, 9
	};

	glEnableClientState(GL_TEXTURE_COORD_ARRAY);
	glTexCoordPointer(2, GL_FLOAT, 0, TexCoordData);
	glEnableClientState(GL_NORMAL_ARRAY);
	glNormalPointer(GL_FLOAT, 0, NormalData);
	glEnableClientState(GL_VERTEX_ARRAY);
	glVertexPointer(3, GL_FLOAT, 0, VertexData);

	OGL_Set_Current_Material_Parameters(32.0000f, 1.00000f, 1.00000f, 1.00000f, 0.000000f, 0.000000f, 0.000000f);

	// Set a new diffuse texture map
        OGL_Set_Current_Texture_Map(holz1, 1.00000f, 1.00000f, 0.000000f, 0.000000f);
	glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, &Indices[0]);
	glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, &Indices[3]);
	glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, &Indices[6]);
	glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, &Indices[9]);
	glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, &Indices[12]);
	glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, &Indices[15]);
	glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, &Indices[18]);
	glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, &Indices[21]);
	glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, &Indices[24]);
	glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, &Indices[27]);
	glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, &Indices[30]);
	glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, &Indices[33]);
}	// End of polygons for object 'Box03'
